/**
 */
package fUML.Semantics.Activities.IntermediateActivities.impl;

import fUML.Semantics.Activities.IntermediateActivities.ActivityEdgeInstance;
import fUML.Semantics.Activities.IntermediateActivities.DecisionNodeActivation;
import fUML.Semantics.Activities.IntermediateActivities.IntermediateActivitiesPackage;
import fUML.Semantics.Activities.IntermediateActivities.Token;

import fUML.Semantics.Classes.Kernel.Value;

import fUML.Semantics.CommonBehaviors.BasicBehaviors.Execution;

import fUML.Syntax.Classes.Kernel.ValueSpecification;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Decision Node Activation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fUML.Semantics.Activities.IntermediateActivities.impl.DecisionNodeActivationImpl#getDecisionInputExecution <em>Decision Input Execution</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DecisionNodeActivationImpl extends ControlNodeActivationImpl implements DecisionNodeActivation {
	/**
	 * The cached value of the '{@link #getDecisionInputExecution() <em>Decision Input Execution</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDecisionInputExecution()
	 * @generated
	 * @ordered
	 */
	protected Execution decisionInputExecution;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DecisionNodeActivationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return IntermediateActivitiesPackage.Literals.DECISION_NODE_ACTIVATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Execution getDecisionInputExecution() {
		return decisionInputExecution;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetDecisionInputExecution(Execution newDecisionInputExecution, NotificationChain msgs) {
		Execution oldDecisionInputExecution = decisionInputExecution;
		decisionInputExecution = newDecisionInputExecution;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION, oldDecisionInputExecution, newDecisionInputExecution);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDecisionInputExecution(Execution newDecisionInputExecution) {
		if (newDecisionInputExecution != decisionInputExecution) {
			NotificationChain msgs = null;
			if (decisionInputExecution != null)
				msgs = ((InternalEObject)decisionInputExecution).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION, null, msgs);
			if (newDecisionInputExecution != null)
				msgs = ((InternalEObject)newDecisionInputExecution).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION, null, msgs);
			msgs = basicSetDecisionInputExecution(newDecisionInputExecution, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION, newDecisionInputExecution, newDecisionInputExecution));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Value> getDecisionValues(EList<Token> incomingTokens) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Value executeDecisionInputBehavior(Value inputValue, Value decisionInputValue) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Value getDecisionInputFlowValue() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivityEdgeInstance getDecisionInputFlowInstance() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean test(ValueSpecification guard, Value value) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Token> removeJoinedControlTokens(EList<Token> incomingTokens) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean hasObjectFlowInput() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION:
				return basicSetDecisionInputExecution(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION:
				return getDecisionInputExecution();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION:
				setDecisionInputExecution((Execution)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION:
				setDecisionInputExecution((Execution)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case IntermediateActivitiesPackage.DECISION_NODE_ACTIVATION__DECISION_INPUT_EXECUTION:
				return decisionInputExecution != null;
		}
		return super.eIsSet(featureID);
	}

} //DecisionNodeActivationImpl
